<div class="m-tab s-tab">
	<h2 class="u-tt">{$formInfo.name}字段管理</h2>
	<ul>
		<li><a href="<?php echo url('AdminFormField/index',array('form_id'=>$formInfo['form_id'])); ?>">字段列表</a></li>
		<li class="z-crt"><a href="javascript:;">{$actionName}字段</a></li>
	</ul>
</div>
<div class="m-form">
	<form name="" action="<?php echo url('AdminFormField/'.$action.'Data'); ?>" method="post" id="form">
		<fieldset>
			<div class="formitm">
				<label class="lab">名称：</label>
				<div class="ipt">
					<input name="name" type="text" class="u-ipt u-ipt-5" id="name" value="{$info.name}" maxlength="100" datatype="*" />
					<p>字段描述</p>
				</div>
			</div>
			<div class="formitm">
				<label class="lab">字段名：</label>
				<div class="ipt">
					<input name="field" type="text" class="u-ipt u-ipt-5" id="field" value="{$info.field}" maxlength="20" datatype="/^\w+$/" errormsg="字段表名只能为英文数字和下划线！"  />
					<p>数据库真实字段</p>
				</div>
			</div>
			<div class="formitm">
				<label class="lab" >字段类型：</label>
				<div class="ipt">
					<div class="txt">
						<select name="type" id="type" class="u-slt">
							<!--{loop="$typeField $key $vo"}-->
							<option value="{$key}" <?php if($info['type']==$key){ ?> selected="selected" <?php } ?> >{$vo.name} (<?php echo $propertyField[$vo['property']]['name']; ?>)</option>
							<!--{/loop}-->
						</select>
					</div>
				</div>
			</div>
			<div class="formitm">
        <label class="lab" >字段提示：</label>
        <div class="ipt">
          <input name="tip" type="text" class="u-ipt u-ipt-5" value="{$info.tip}" />
          <p>字段后面的提示信息</p> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >字段验证：</label>
        <div class="ipt">
          <div class="txt">
            <input name="datatype" type="text" class="u-ipt" id="datatype" value="{$info.datatype|unserialize}" />
			<select class="u-slt" id="datatype-list">
				<option value="">=选择预设规则==</option>
				<option value="*">不为空</option>
				<option value="*6-16">6到16位任意字符</option>
				<option value="n">数字类型</option>
				<option value="n6-16">6到16位数字</option>
				<option value="s">字符串</option>
				<option value="s6-18">6到18位字符串</option>
				<option value="p">邮政编码</option>
				<option value="m">手机号码</option>
				<option value="e">email</option>
				<option value="url">网址</option>
			</select>
          </div>
          <p>不验证请留空，否则选择验证或输入正则，如/\w{3,6}/i</p> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >验证失败提示：</label>
        <div class="ipt">
          <div class="txt">
            <input name="errormsg" type="text" class="u-ipt u-ipt-5" id="errormsg" value="{$info.errormsg}" />
          </div>
          <p>验证失败后的提示信息，设置验证规则后请填写</p> </div>
      </div>
	   <div class="formitm">
        <label class="lab" >默认内容：</label>
        <div class="ipt">
		  <input name="default" type="text" class="u-ipt u-ipt-5" id="default" value="{$info.default}" />
          <p>默认的内容，如果为选择或下拉等类型时填写默认选择项目，多个用","分隔开</p> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >字段配置：</label>
        <div class="ipt">
          <input name="config" type="text" class="u-ipt u-ipt-5" id="config" value="{$info.config}" />
          <p>如果为选择或下拉等类型，时多个项目用","分隔开</p> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >字段顺序：</label>
        <div class="ipt">
          <input name="sequence" type="text" class="u-ipt u-ipt-1" id="sequence" value="{$info.sequence|is_empty:'0'}"  datatype="n" errormsg="字段顺序只能为数字" />
          <p>数字越小越靠前</p> </div>
      </div>
	  	<div class="formitm">
        <label class="lab" >HTML大小：</label>
        <div class="ipt">
          <input name="size" type="text" class="u-ipt u-ipt-1" id="size" value="{$info.size|is_empty:5}" maxlength="1" datatype="n" errormsg="HTML大小只能为数字" />
          <p>字段html整体大小1~6代表不同大小</p> 
          </div>
      </div>
	  <div class="formitm">
        <label class="lab" >外部录入：</label>
        <div class="ipt">
          <div class="txt">
            <?php if(!isset($info['delivery'])){ $info['delivery']=1; } ?>
			<label class="u-opt">
            <input name="delivery" type="radio" value="1" <?php if($info['delivery']==1){ ?> checked="checked" <?php } ?> />
            是
			</label>
            <label class="u-opt">
            <input name="delivery" type="radio" value="0" <?php if($info['delivery']==0){ ?> checked="checked" <?php } ?> />
            否 
			</label></div>
          <p>扩展选项，是否可以让外部提交本字段</p> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >后台列表显示：</label>
        <div class="ipt">
          <div class="txt">
			<label class="u-opt">
            <input name="display" type="radio" value="1" <?php if($info['display']==1){ ?> checked="checked" <?php } ?> />
            是
			</label>
            <label class="u-opt">
            <input name="display" type="radio" value="0" <?php if($info['display']==0){ ?> checked="checked" <?php } ?> />
            否 
			</label></div>
          <p>后台列表页是否显示</p> </div>
      </div>
			<div class="formitm formitm-1  formitm-2">
				<input name="form_id" type="hidden" value="{$formInfo['form_id']}" />
				<input name="field_id" type="hidden" value="{$info.field_id}" />
				<button class="u-btn" type="submit">保存</button>
				<button class="u-btn s-btn-c3" type="reset">重置</button>
				<span class="status" id="status"></span> </div>
		</fieldset>
	</form>
</div>
<script>
Do.ready('base','form','dialog',function() {
	$('#form').duxForm({returnUrl:"<?php echo url('AdminFormField/index',array('form_id'=>$formInfo['form_id'])); ?>"});
	$('#datatype-list').change(function() {
		if($(this).val()!=''){
			$('#datatype').val($(this).val());
		}
	});
});
</script>